package com.service.device;

import com.dao.secondary.device.DevicePcbErrorInfoMapper;
import com.dao.secondary.device.DevicePcbErrorRecordInfoMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.model.domain.device.GetDevicePcbErrorInfoDO;
import com.model.domain.device.GetDevicePcbErrorRecordInfoDO;
import com.model.pojo.device.DevicePcbErrorInfo;
import com.model.pojo.device.DevicePcbErrorRecordInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @Author: zql
 * @Description: 安卓版设备异常情况信息记录服务
 * @Data: 2023-06-21
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class DevicePcbErrorInfoService {
    private final DevicePcbErrorInfoMapper devicePcbErrorInfoMapper;

    public List<DevicePcbErrorInfo> getPageList(GetDevicePcbErrorInfoDO getDevicePcbErrorInfoDO){
        PageHelper.clearPage();
        PageHelper.startPage(getDevicePcbErrorInfoDO.getPage(),getDevicePcbErrorInfoDO.getPageSize(),getDevicePcbErrorInfoDO.getSortRow()+getDevicePcbErrorInfoDO.getSortOrder());
        return devicePcbErrorInfoMapper.selectList(getDevicePcbErrorInfoDO);
    }
    public DevicePcbErrorInfo getByDtu(String dtu){
        return devicePcbErrorInfoMapper.selectByDtu(dtu);
    }
}
